Current Location: Home> Function Categories> min

min

Find the minimum value
Name:min
Category:math
Programming Language:php
One-line Description:Returns the minimum value.

Definition and usage

min() returns the minimum value.

Example

In this example, we will use min() to return the minimum value of the two specified numbers:

 <?php
echo ( min ( 5 , 7 ) ) ;
echo ( min ( - 3 , 5 ) ) ;
echo ( min ( - 3 , - 5 ) ) ;
echo ( min ( 7.25 , 7.30 ) ) ;
?>

Try it yourself

grammar

 min ( x , y )
parameter describe
x Required. A number.
y Required. A number.

illustrate

min() returns the smallest value in the parameter.

If there is only one parameter and is an array, min() returns the smallest value in the array. If the first parameter is an integer, string, or floating point number, at least two parameters are required and min() returns the smallest of these values. An infinite number of values ​​can be compared.

Similar Functions
Popular Articles